package com.swmutil.swmutil.sqlite;

/**
 * @author 师文明
 * @data 2024/10/21 下午5:21
 **/

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;


/**
 * @title: IndexStageManager
 * @Author cpf
 * @Date: 2023/9/2
 * @Version 1.0
 */
public class ProjectStaticManager {
    /**
     * SQLite database
     */
    public static Connection connection = null;
    public static Statement statement = null;

    static {
        // 加载SQLite驱动程序
        try {
            Class.forName("org.sqlite.JDBC");
            // 创建数据库连接
            connection = DriverManager.getConnection("jdbc:sqlite:src/main/resources/database.db");

            // 创建Statement对象
            statement = ProjectStaticManager.connection.createStatement();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}


